<?php
echo "<select name=gender>";
if ($sel == M) $selected = "selected"; else $selected = "";
echo "<option " . $selected . " value=M>男-M";
if ($sel == F) $selected = "selected"; else $selected = "";
echo "<option " . $selected . " value=F>女-F";
echo "</select>";
?>